package cn.wolfcode.luowowo.web.controller;

import cn.wolfcode.luowowo.common.Result;
import cn.wolfcode.luowowo.feign.UserInfoFeignApi;
import cn.wolfcode.luowowo.msg.WebSiteCodeMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by wolfcode-lanxw
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private UserInfoFeignApi userInfoFeignApi;
    @PostMapping("/userLogin")
    public Result<Map> userLogin(String username, String password){
        Result<Map> result = userInfoFeignApi.userLogin(username,password);
        if(result==null){
            return Result.error(WebSiteCodeMsg.MEMBER_SERVER_ERROR);
        }
        return result;
    }
}
